#!/bin/bash

echo `git pull`

PID=`ps -ef |grep python3 | grep -v grep | awk '{print $1}'`
echo ${PID}

if test -z ${PID}
then
	echo "进程没有启动！"
else
	echo "终止线程"${PID}
	kill -9 ${PID}
	sleep 1
fi

echo "开始启动"

nohup python3 WebService.py >> WebServicelog/log.txt 2>&1 &

PID=`ps -ef |grep python3 | grep -v grep | awk '{print $1}'`
echo "启动成功 pid："${PID}